package cn.itcast.consumer;

import cn.itcast.consumer.config.MyRule;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@EnableDiscoveryClient  //消费方
@SpringBootApplication
@EnableEurekaClient
//@RibbonClient(name = "EUREKA-PROVIDER",configuration = MyRule.class)   //ribbon客户端
@EnableFeignClients
public class ConsumerApp {
    public static void main(String[] args) {
        SpringApplication.run(ConsumerApp.class,args);
    }

//    @Bean
//    @LoadBalanced   //
//    public RestTemplate restTemplate(){
//        return new RestTemplate();
//    }
}
